<template>
  <a-layout-sider width="200" style="background: #fff">
    <a-menu
      mode="inline"
      v-model:selectedKeys="selectedKeys2"
      v-model:openKeys="openKeys"
      :style="{ height: '100%', borderRight: 0 }"
    >
      <a-sub-menu key="sub1">
        <template #title>
          <!--          <router-link to="/console/doctor">-->
          <span>
            <laptop-outlined />
            基础管理
          </span>
          <!--          </router-link>-->
        </template>
        <a-menu-item key="1">
          <router-link v-if="roleId == 1" to="/console/area"> 区域管理 </router-link>
          <router-link v-else to="/console/noPrivilege"> 区域管理 </router-link>
        </a-menu-item>
        <a-menu-item key="2">
          <router-link v-if="roleId <= 2" to="/console/department"> 部门管理 </router-link>
          <router-link v-else to="/console/noPrivilege"> 部门管理 </router-link>
        </a-menu-item>
        <a-menu-item key="3">
          <router-link v-if="roleId == 1" to="/console/hospital"> 医院管理 </router-link>
          <router-link v-else to="/console/noPrivilege"> 医院管理 </router-link>
        </a-menu-item>
        <a-menu-item key="4">
          <router-link v-if="roleId <= 2" to="/console/role"> 权限管理 </router-link>
          <router-link v-else to="/console/noPrivilege"> 权限管理 </router-link>
        </a-menu-item>
        <a-menu-item key="5">
          <router-link to="/console/condition"> 疾病定义管理 </router-link>
        </a-menu-item>
      </a-sub-menu>
      <a-sub-menu key="sub2">
        <template #title>
          <span>
            <user-outlined />

            人员管理
          </span>
        </template>
        <a-menu-item key="6">
          <router-link to="/console/patient"> 病人管理 </router-link>
        </a-menu-item>
        <a-menu-item key="7">
          <router-link v-if="roleId <= 2" to="/console/doctor">医生管理</router-link>
          <router-link v-else to="/console/noPrivilege">医生管理</router-link>
        </a-menu-item>
      </a-sub-menu>
      <a-sub-menu key="sub3">
        <template #title>

          <span>
            <notification-outlined />
            诊断管理
          </span>
        </template>
        <a-menu-item key="9">
          <router-link to="/console/cure">治疗管理</router-link>
        </a-menu-item>
        <a-menu-item key="10">
          <router-link to="/console/checkout">检验报告</router-link>
        </a-menu-item>
        <a-menu-item key="11">
          <router-link to="/console/visitInfo">会诊记录</router-link>
        </a-menu-item>
        <a-menu-item key="12">
          <router-link to="/console/illnessInfo">病情记录</router-link>
        </a-menu-item>
      </a-sub-menu>
      <a-menu-item key="14">
        <router-link to="/console/consultation">
          <template #icon>
<!--            <MailOutlined />-->
          </template>
          <medicine-box-outlined />
          <span>远程问诊</span>
        </router-link>
      </a-menu-item>
      <a-menu-item key="15">
        <router-link to="/console/visit">
          <message-outlined />
          <span>远程接诊</span>
        </router-link>
      </a-menu-item>
    </a-menu>
  </a-layout-sider>
</template>

<script>
import { onMounted, ref } from "vue";
import {
  UserOutlined,
  LaptopOutlined,
  NotificationOutlined,
  MessageOutlined,
  MedicineBoxOutlined
} from "@ant-design/icons-vue";
export default {
  components: {
    UserOutlined,
    LaptopOutlined,
    NotificationOutlined,
    MessageOutlined,
    MedicineBoxOutlined
  },
  setup() {
    const roleId = ref(0);
    onMounted(() => {
      roleId.value = sessionStorage.getItem("roleId");
    });
    return {
      roleId,
    };
  },
};
</script>

<style>
</style>
